
<script type="text/javascript" >
    AppComm.include.load("<@baseUrl url='/static/comm/js/monitor/server.js'/>","js");
</script>

<div style="padding: 10px; background-color: #F2F2F2;">
    <div class="server_box"></div>
</div>

<script type="text/html" id="server_template">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">CPU</div>
                <div class="layui-card-body">
                    <table class="layui-table" lay-skin="nob">
                        <colgroup>
                            <col width="150">
                            <col width="150">
                        </colgroup>
                        <thead>
                        <tr>
                            <th><b>属性</b></th>
                            <th><b>值</b></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>CPU核数</td>
                            <td>{{cpu.cpuNum}}</td>
                        </tr>
                        <tr>
                            <td>用户使用率</td>
                            <td>{{cpu.used}}%</td>
                        </tr>
                        <tr>
                            <td>系统使用率</td>
                            <td>{{cpu.sys}}%</td>
                        </tr>
                        <tr>
                            <td>当前空闲率</td>
                            <td>{{cpu.free}}%</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">内存</div>
                <div class="layui-card-body">
                    <table class="layui-table" lay-skin="nob">
                        <colgroup>
                            <col width="100">
                            <col width="100">
                            <col width="100">
                        </colgroup>
                        <thead>
                        <tr>
                            <th><b>属性</b></th>
                            <th><b>内存</b></th>
                            <th><b>JVM</b></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>总内存</td>
                            <td>{{mem.total}}G</td>
                            <td>{{jvm.total}}M</td>
                        </tr>
                        <tr>
                            <td>已用内存</td>
                            <td>{{mem.used}}G</td>
                            <td>{{jvm.used}}M</td>
                        </tr>
                        <tr>
                            <td>剩余内存</td>
                            <td>{{mem.free}}G</td>
                            <td>{{jvm.free}}M</td>
                        </tr>
                        <tr>
                            <td>使用率</td>
                            <td>{{mem.usage}}%</td>
                            <td>{{jvm.usage}}%</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">服务器信息</div>
                <div class="layui-card-body">
                    <table class="layui-table" lay-even="" lay-skin="nob">
                        <colgroup>
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                        </colgroup>
                        <thead>
                        <tr>
                            <th><b>服务器名称</b></th>
                            <th><b>服务器IP</b></th>
                            <th><b>操作系统</b></th>
                            <th><b>系统架构</b></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>{{sys.computerName}}</td>
                            <td>{{sys.computerIp}}</td>
                            <td>{{sys.osName}}</td>
                            <td>{{sys.osArch}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">Java虚拟机信息</div>
                <div class="layui-card-body">
                    <table class="layui-table" lay-even="" lay-skin="nob">
                        <colgroup>
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                        </colgroup>
                        <thead>
                        <tr>
                            <th><b>Java名称</b></th>
                            <th><b>Java版本</b></th>
                            <th><b>启动时间</b></th>
                            <th><b>运行时长</b></th>
                            <th><b>安装路径</b></th>
                            <th><b>项目路径</b></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>{{jvm.name}}</td>
                            <td>{{jvm.version}}</td>
                            <td>{{jvm.startTime}}</td>
                            <td>{{jvm.runTime}}</td>
                            <td>{{jvm.home}}</td>
                            <td>{{sys.userDir}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">磁盘状态</div>
                <div class="layui-card-body">
                    <table class="layui-table" lay-skin="nob">
                        <colgroup>
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                        </colgroup>
                        <thead>
                        <tr>
                            <th><b>盘符路径</b></th>
                            <th><b>文件系统</b></th>
                            <th><b>盘符类型</b></th>
                            <th><b>总大小</b></th>
                            <th><b>可用大小</b></th>
                            <th><b>已用大小</b></th>
                            <th><b>已用百分比</b></th>
                        </tr>
                        </thead>
                        <tbody>
                        {{each sysFiles as sysFile i}}
                        <tr>
                            <td>{{sysFile.dirName}}</td>
                            <td>{{sysFile.sysTypeName}}</td>
                            <td>{{sysFile.typeName}}</td>
                            <td>{{sysFile.total}}</td>
                            <td>{{sysFile.free}}</td>
                            <td>{{sysFile.used}}</td>
                            <td>{{sysFile.usage}}%</td>
                        </tr>
                        {{/each}}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</script>